var e = require("../component/cpsApi");

Page({
    behaviors: [ e ],
    data: {
        id: "",
        phone: "",
        need_mobile: ""
    },
    onLoad: function(e) {
        this.setData({
            id: e.plat_id,
            need_mobile: e.need_mobile
        }), 1 == this.data.need_mobile ? this.getPhone() : this.getCPSLogin("link");
    },
    getPhone: function() {
        var e = this, n = app.getNetAddresss("plugin.aggregation-cps.api.web.getMobile");
        app._getNetWork({
            url: n,
            success: function(n) {
                var o = n.data.mobile;
                1 == o.result ? (e.setData({
                    phone: o.data
                }), e.data.phone ? e.getCPSLogin("link") : wx.navigateTo({
                    url: "/packageA/member/editmobile/editmobile"
                })) : wx.showToast({
                    title: o.msg,
                    icon: "none"
                });
            },
            fail: function(e) {
                console.log(e, "错误");
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});